home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / fp-206b.zip / VIRUS.DOC < prev   
Text File  |  1992-02-03  |  11KB  |  216 lines

  1.  
  2.                          Computer Viruses: An Introduction
  3.  
  4. A very simple definition of computer viruses is:
  5.  
  6.         "A program that modifies other programs by placing a copy of 
  7.          itself inside them."
  8.  
  9. This definition is somewhat simplified, but is sufficient to show the
  10. major difference between viruses and so-called "Trojan" programs, which
  11. is that the virus replicates, but the Trojan does not.  (The definition
  12. does not cover the so-called "companion"-type viruses, however).
  13.  
  14. A Trojan is a program that pretends to do something useful (or at least
  15. interesting), but when it is run, it may have some harmful effect, like
  16. scrambling your FAT (File Allocation Table) or formatting the hard disk.
  17.  
  18. Viruses and Trojans may contain a "time-bomb", intended to destroy
  19. programs or data on a specific date or when some condition has been
  20. fulfilled.
  21.  
  22. A time bomb is often designed to be harmful, maybe doing something like
  23. formatting the hard disk.  Sometimes it is relatively harmless, perhaps 
  24. slowing the computer down every Friday or making a ball bounce around the
  25. screen.  However, there is really no such thing as a harmless virus.  Even if
  26. a virus has been intended to cause no damage, it may do so in certain cases,
  27. often due to the incompetence of the virus writer.  A virus may be modified,
  28. either by the original author or someone else, so that a more harmful version
  29. of it appears.  It is also possible that the modification produces a less
  30. harmful virus, but that has only rarely happened.
  31.  
  32. The damage caused by a virus may consist of the deletion of data or
  33. programs, maybe even reformatting of the hard disk, but more subtle damage
  34. is also possible.  Some viruses may modify data or introduce typing errors
  35. into text.  Other viruses may have no intentional effects other than just
  36. replicating.
  37.  
  38. Two different groups of viruses occur on PCs, boot sector viruses (BSV)
  39. and program viruses, although a few viruses belong to both groups.
  40.  
  41. A BSV infects the boot sector on a diskette.  Normally the boot sector
  42. contains code to load the operating system files.  The BSV replaces the
  43. original boot sector with itself and stores the original boot sector
  44. somewhere else on the diskette or simply replaces it totally.  When a
  45. computer is then later booted from this diskette, the virus takes control
  46. and hides in RAM.  It will then load and execute the original boot sector,
  47. and from then on everything will be as usual.  Except, of course, that
  48. every diskette inserted in the computer will be infected with the virus,
  49. unless it is write-protected.  
  50.  
  51. A BSV will usually hide at the top of memory, reducing the amount of
  52. memory that the DOS sees.  For example, a computer with 640K might appear
  53. to have only 639K.
  54.  
  55. Many BSVs are also able to infect hard disks, where the process is similar
  56. to that described above, although they may infect the master boot
  57. record instead of the DOS boot record.
  58.  
  59. Program viruses, the second type of computer viruses, infect executable
  60. programs, usually .COM and .EXE files, but sometimes also overlay files.
  61. An infected program will contain a copy of the virus, usually at the end,
  62. but in some cases at the beginning of the original program.
  63.  
  64. When an infected program is run, the virus may stay resident in memory
  65. and infect every program run.  Viruses using this method to spread the
  66. infection are called "Resident Viruses".
  67.  
  68. Other viruses may search for a new file to infect, when an infected
  69. program is executed.  The virus then transfers control to the original
  70. program.  Viruses using this method to spread the infection are
  71. called "Direct Action Viruses".  It is possible for a virus to use both
  72. methods of infection.
  73.  
  74. Most viruses try to recognize existing infections, so they do not infect
  75. what has already been infected.  This makes it possible to inoculate
  76. against specific viruses, by making the "victim" appear to be infected.
  77. However, this method is useless as a general defense, as it is not 
  78. possible to inoculate the same program against multiple viruses.
  79.  
  80. In general, viruses are rather unusual programs, rather simple, but written
  81. just like any other program.  It does not take a genius to write one - any
  82. average assembly language programmer can easily do it.  Fortunately, few of
  83. them do.
  84.  
  85. Now - to correct some common misconceptions, here are a few bits of
  86. information about what viruses cannot do.
  87.  
  88.         A virus cannot spread from one type of computer to another.
  89.         For example, a virus designed to infect Macintosh computers cannot
  90.         infect PCs or vice versa.
  91.  
  92.         A virus cannot appear all by itself, it has to be written, just
  93.         like any other program.
  94.         
  95.         Not all viruses are harmful; some may only cause minor damage as
  96.         a side effect.
  97.  
  98.         A virus cannot infect a computer unless it is booted from an
  99.         infected diskette or an infected program is run on it.  Reading
  100.         data from an infected diskette cannot cause an infection.
  101.  
  102.         A write-protected diskette cannot become infected.
  103.  
  104.         There is no way a virus can attach itself to data files, so
  105.         viruses cannot be distributed with them.  However, a BSV can
  106.         be distributed on data diskettes.
  107.  
  108. The F-PROT package will provide protection against viruses, but there are
  109. other methods that also should be used.  Before I list them, I want to
  110. warn you against three methods that are of very limited use.
  111.  
  112. One anti-virus measure consists of making every executable file read-only,
  113. by issuing commands like
  114.  
  115.                         ATTRIB +R *.EXE
  116.  
  117. This is actually not a bad idea, but it will not provide much protection
  118. against viruses.  Most program viruses will remove this protection before
  119. they infect files, and restore it afterwards.  Making files read-only will
  120. of course have no effect on BSVs.  The main purpose of this method is actually
  121. to protect the user from his own mistakes, because this makes it harder to
  122. delete programs by mistake.  However, some viruses are stopped by this
  123. method, "Lehigh" and "South African" in particular.
  124.  
  125. Another method is to hide the COMMAND.COM file, by giving the following
  126. sequence of instructions:
  127.  
  128.         MKDIR C:\HIDDEN
  129.         COPY COMMAND.COM C:\HIDDEN
  130.         DEL COMMAND.COM
  131.  
  132.         add SHELL=C:\HIDDEN\COMMAND.COM /P to CONFIG.SYS
  133.         add SET COMSPEC=C:\HIDDEN\COMMAND.COM to AUTOEXEC.BAT
  134.  
  135. This method is quite useless, to say the least.  Few viruses infect
  136. COMMAND.COM, and some of them are able to do it, even if it has been
  137. hidden, using this method.
  138.  
  139. A third useless method is to change the name of COMMAND.COM and patch other
  140. programs so they use the new name.  Somebody who had only heard of the "Lehigh"
  141. virus got this "bright" idea.  Apparently he thought that all other viruses
  142. operated like it, so he wrote and distributed a program to do this
  143. automatically.  He thought it was a general cure for the virus problem, but
  144. he was wrong.
  145.  
  146. On the other hand, there are a number of ways to provide useful protection.
  147.  
  148.     Rule #1 is: MAKE BACKUPS!!!  Keep good backups (more than one) of
  149.         everything you do not want to lose.  This will not only protect you
  150.         from serious damage caused by viruses, but is also necessary in the
  151.         case of a serious hardware failure.
  152.  
  153.         Never boot a computer with a hard disk from a diskette because that
  154.         is the only way the hard disk could become infected with a BSV.
  155.  
  156.         Should you, by accident, have left a non-bootable diskette in
  157.         drive A: when you turn the computer on, the message
  158.  
  159.                         Not a system disk.
  160.  
  161.         may appear.  If the diskette was infected with a virus, it will now
  162.         be active, but may not have infected the hard disk yet. if this
  163.         happens, turn the computer off, or press the reset button.  It is
  164.         important to note that pressing Ctrl-Alt-Del will not be sufficient,
  165.         as a few viruses can survive that.
  166.  
  167.         If the computer has no hard disk, but is booted from a diskette,
  168.         you should always use the same diskette, and keep it write-protected.
  169.  
  170.         Keep all diskettes write-protected unless you need to write to them.
  171.         When you obtain new software on a diskette, write-protect the
  172.         diskette before you make a backup copy of it.  If it is not possible
  173.         to make a backup of the diskette, because of some idiotic
  174.         copy-protection, I do not recommend using the software.
  175.  
  176.         Be really careful regarding your sources of software.  In general,
  177.         shrink-wrapped commercial software should be "clean", but there
  178.         have been a few documented cases of infected commercial software.
  179.         Public-Domain, Freeware and Shareware packages do not have to be
  180.         any more dangerous - it all depends on the source.  If you obtain
  181.         software from a BBS, check what precautions the SysOp takes against
  182.         viruses.  If he does not screen the software made available for
  183.         downloading, you should find another source.
  184.  
  185.     Check all new software for infection before you run it for the
  186.     first time.  It is even advisable to use a couple of scanners from
  187.     different manufacturers, as no single scanner is able to detect
  188.     all viruses.
  189.  
  190.         Obtain Shareware, Freeware and Public-Domain software from the
  191.         original author, if at all possible.  
  192.  
  193.         Look out for any "unusual" behavior on your computer, like:
  194.  
  195.                 Does it take longer than usually to load programs ?
  196.                 Do unusual error messages appear ?
  197.                 Does the memory size seem to have decreased ?
  198.                 Do the disk lights stay on longer than they used to ?
  199.                 Do files just disappear ?
  200.  
  201. Anything like this might indicate a virus infection.
  202.  
  203. If your computer is infected with a virus - DON'T PANIC!  Sometimes a
  204. badly thought out attempt to remove a virus will do much more damage
  205. than the virus could have done.  If you are not sure what to do, leave
  206. your computer turned off until you find someone to remove the virus for
  207. you.
  208.  
  209. Finally, remember that some viruses may interfere with the disinfection
  210. operation if they are active in memory at that time, so before attempting
  211. to disinfect you MUST boot the computer from a CLEAN system diskette.
  212.  
  213. It is also a good idea to boot from a clean system diskette before
  214. scanning for viruses, as several "stealth" viruses are very difficult do
  215. detect if they are active in memory during virus scanning.
  216.